package com.cx.mall.gateway.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/fallback")
public class FallbackController {

    @GetMapping("/alipay")
    public Mono<Map<String, Object>> alipayFallback(ServerWebExchange exchange) {
        Map<String, Object> response = new HashMap<>();
        response.put("success", false);
        response.put("code", "GATEWAY_TIMEOUT");
        response.put("message", "Alipay service is temporarily unavailable. Please try again later.");
        response.put("timestamp", System.currentTimeMillis());
        
        return Mono.just(response);
    }
}

